﻿<!-- DA USARE SOLO IN PAGINA WIKI (LAYOUT DI)-->
<div id="TSF_doccorrel_containerWiki">
    <!--<img alt="wait" width="30px" height="30px" src="/_layouts/images/ajax-loader.gif" />-->
</div>
<script type="text/javascript" src="/_layouts/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
    // ---------------------------------------------------
    // IMPOSTARE false SE INSTALLAZIONE SU VERSIONE SERVER
    var TSF_SHAREPOINT_FOUNDATION = false;
    // ---------------------------------------------------
    function TSF_show_DocCorrelWiki(ajObj,status) {
        if (status == "success")
            document.getElementById("TSF_doccorrel_containerWiki").innerHTML = ajObj.responseText;
        else 
            document.getElementById("TSF_doccorrel_containerWiki").innerHTML = "<span></span>";
    }
    function TSF_parseUrl_forIDWiki() {
        var ret = "";
        var arVar;
        if (location.search.indexOf("&") > -1) {
            arVar = location.search.substr(1).split("&");
        }
        else arVar = [location.search.substr(1)];
        for (var i = 0; i < arVar.length; i++) {
            if (arVar[i].indexOf("ID=") > -1 || arVar[i].indexOf("RootFolder=") > -1) {
                ret = arVar[i];
                break;
            }
        }
        return ret;
    }
    function TSF_startCorrelatiWiki() {
        var aspxPage = TSF_SHAREPOINT_FOUNDATION ? "DocumentiCorrelatiSearch.aspx" : "DocumentiCorrelatiServer.aspx"
        var TSF_doccorr_pageurl;
        if (location.search.length > 0)
            TSF_doccorr_pageurl = "PageUrl=" + location.href.substr(0, location.href.indexOf(location.search));
        else TSF_doccorr_pageurl = "PageUrl=" + location.href;
        var TSF_doccorr_query = TSF_parseUrl_forIDWiki();
        var TSF_doccorr_url;
        TSF_doccorr_url = "../_layouts/" + aspxPage;
        $.ajax({
            url:TSF_doccorr_url,
            type:"GET",
            dataType:"html",
            data:TSF_doccorr_pageurl + "&ID=0",
            complete:TSF_show_DocCorrelWiki
            });
    }
    _spBodyOnLoadFunctionNames.push("TSF_startCorrelatiWiki");
	            
</script>

